
* THE HABSBURG MANIFESTO DATASET - HMD 
* Szöcsik, E., Zuber, C. I., & Howe, P. J. (2023). Lipset and Rokkan's missing case: Introducing the Habsburg Manifesto Dataset. Party Politics, 13540688231185671.

* Replication file for the analysis
*** Section "Assessing the salience of policy issues and group identities" ***

use "hmd-EA1-4", clear

*Table 1. Three most salient issues and groups by election 

* Create weights from seat shares

gen seatshare = seats/totalseats
sort election
by election: egen seatshare_ps = sum(seatshare)
gen weight = seatshare/seatshare_ps 

* Weighted salience of issues

gen greatergermanyE_w = greatergermanyE * weight
gen warE_w = warE * weight
gen milservE_w = milservE * weight
gen citarmyE_w = citarmyE * weight
gen demE_w = demE * weight
gen elecinE_w = elecinE * weight
gen parlE_w = parlE * weight
gen civlibE_w = civlibE * weight
gen rulelawE_w = rulelawE * weight
gen spechunE_w = spechunE * weight
gen fedE_w = fedE * weight
gen secE_w = secE * weight
gen capismE_w = capismE * weight
gen ftradeE_w = ftradeE * weight
gen exploitE_w = exploitE * weight
gen growthE_w = growthE * weight
gen unempE_w = unempE * weight
gen debtE_w = debtE * weight
gen interestE_w = interestE * weight
gen taxE_w = taxE * weight
gen coopE_w = coopE * weight
gen trunionE_w = trunionE * weight
gen infraE_w = infraE * weight
gen soceqE_w = soceqE * weight
gen socsecE_w = socsecE * weight
gen pubhealthE_w = pubhealthE * weight
gen pubeducE_w = pubeducE * weight
gen classconE_w = classconE * weight
gen tradvalE_w = tradvalE * weight
gen sepchE_w = sepchE * weight
gen nationalismE_w = nationalismE * weight
gen langrightE_w = langrightE * weight
gen grouprepE_w = grouprepE * weight
gen immigE_w = immigE * weight

by election: egen greatergermanyE_sum = sum(greatergermanyE_w)
by election: egen warE_sum = sum(warE_w)
by election: egen milservE_sum = sum(milservE_w)
by election: egen citarmyE_sum = sum(citarmyE_w)
by election: egen demE_sum = sum(demE_w)
by election: egen elecinE_sum = sum(elecinE_w)
by election: egen parlE_sum = sum(parlE_w)
by election: egen civlibE_sum = sum(civlibE_w)
by election: egen rulelawE_sum = sum(rulelawE_w)
by election: egen spechunE_sum = sum(spechunE_w)
by election: egen fedE_sum = sum(fedE_w)
by election: egen secE_sum = sum(secE_w)
by election: egen capismE_sum = sum(capismE_w)
by election: egen ftradeE_sum = sum(ftradeE_w)
by election: egen exploitE_sum = sum(exploitE_w)
by election: egen growthE_sum = sum(growthE_w)
by election: egen unempE_sum = sum(unempE_w)
by election: egen debtE_sum = sum(debtE_w)
by election: egen interestE_sum = sum(interestE_w)
by election: egen taxE_sum = sum(taxE_w)
by election: egen coopE_sum = sum(coopE_w)
by election: egen trunionE_sum = sum(trunionE_w)
by election: egen infraE_sum = sum(infraE_w)
by election: egen soceqE_sum = sum(soceqE_w)
by election: egen socsecE_sum = sum(socsecE_w)
by election: egen pubhealthE_sum = sum(pubhealthE_w)
by election: egen pubeducE_sum = sum(pubeducE_w)
by election: egen classconE_sum = sum(classconE_w)
by election: egen tradvalE_sum = sum(tradvalE_w)
by election: egen sepchE_sum = sum(sepchE_w)
by election: egen nationalismE_sum = sum(nationalismE_w)
by election: egen langrightE_sum = sum(langrightE_w)
by election: egen grouprepE_sum = sum(grouprepE_w)
by election: egen immigE_sum= sum(immigE_w)


* Weighted salience of groups
gen civicE_w = civicE * weight
gen uppclassE_w = uppclassE * weight
gen midclassE_w = midclassE * weight
gen lowclassE_w = lowclassE * weight
gen capistsE_w = capistsE * weight
gen workersE_w = workersE * weight
gen arisE_w = arisE * weight
gen farmersE_w = farmersE * weight
gen merchE_w = merchE * weight
gen craftE_w = craftE * weight
gen civservE_w = civservE * weight
gen soldiersE_w = soldiersE * weight
gen intellecE_w = intellecE * weight
gen producE_w = producE * weight
gen consumE_w = consumE * weight
gen croE_w = croE * weight
gen czeE_w = czeE * weight
gen gerE_w = gerE * weight
gen hunE_w = hunE * weight
gen itaE_w = itaE * weight
gen jewE_w = jewE * weight
gen polE_w = polE * weight
gen romE_w = romE * weight
gen rutE_w = rutE * weight
gen skE_w = skE * weight
gen sloE_w = sloE * weight
gen slavE_w = slavE * weight
gen nongerE_w = nongerE * weight
gen nonhunE_w = nonhunE * weight
gen christE_w = christE * weight
gen romcatE_w = romcatE * weight
gen protE_w = protE * weight
gen provinceE_w = provinceE * weight
gen regionE_w = regionE * weight
gen cityE_w = cityE * weight
gen localE_w = localE * weight
gen conservativesE_w = conservativesE * weight
gen clericalsE_w = clericalsE * weight
gen liberalsE_w = liberalsE * weight
gen nationalistsE_w = nationalistsE * weight
gen socialistsE_w = socialistsE * weight
gen menE_w = menE * weight
gen womenE_w = womenE * weight
gen oldE_w = oldE * weight
gen youngE_w = youngE* weight


by election: egen civicE_sum= sum(civicE_w)
by election: egen uppclassE_sum = sum(uppclassE_w)
by election: egen midclassE_sum = sum(midclassE_w)
by election: egen lowclassE_sum = sum(lowclassE_w)
by election: egen capistsE_sum = sum(capistsE_w)
by election: egen workersE_sum = sum(workersE_w)
by election: egen arisE_sum = sum(arisE_w)
by election: egen farmersE_sum = sum(farmersE_w)
by election: egen merchE_sum = sum(merchE_w)
by election: egen craftE_sum = sum(craftE_w)
by election: egen civservE_sum = sum(civservE_w)
by election: egen soldiersE_sum = sum(soldiersE_w)
by election: egen intellecE_sum = sum(intellecE_w)
by election: egen producE_sum = sum(producE_w)
by election: egen consumE_sum = sum(consumE_w)
by election: egen croE_sum = sum(croE_w)
by election: egen czeE_sum = sum(czeE_w)
by election: egen gerE_sum = sum(gerE_w)
by election: egen hunE_sum = sum(hunE_w)
by election: egen itaE_sum = sum(itaE_w)
by election: egen jewE_sum = sum(jewE_w)
by election: egen polE_sum = sum(polE_w)
by election: egen romE_sum = sum(romE_w)
by election: egen rutE_sum = sum(rutE_w)
by election: egen skE_sum= sum(skE_w)
by election: egen sloE_sum = sum(sloE_w)
by election: egen slavE_sum = sum(slavE_w)
by election: egen nongerE_sum = sum(nongerE_w)
by election: egen nonhunE_sum = sum(nonhunE_w)
by election: egen christE_sum = sum(christE_w)
by election: egen romcatE_sum = sum(romcatE_w)
by election: egen protE_sum = sum(protE_w)
by election: egen provinceE_sum = sum(provinceE_w)
by election: egen regionE_sum = sum(regionE_w)
by election: egen cityE_sum = sum(cityE_w)
by election: egen localE_sum = sum(localE_w)
by election: egen conservativesE_sum = sum(conservativesE_w)
by election: egen clericalsE_sum = sum(clericalsE_w)
by election: egen liberalsE_sum = sum(liberalsE_w)
by election: egen nationalistsE_sum = sum(nationalistsE_w)
by election: egen socialistsE_sum = sum(socialistsE_w)
by election: egen menE_sum = sum(menE_w)
by election: egen womenE_sum = sum(womenE_w)
by election: egen oldE_sum = sum(oldE_w)
by election: egen youngE_sum= sum(youngE_w)


sort election
by election: gen count = _n
drop if count !=1

drop count


*** Selection of the three most salient issues

gen str30 maxsalstr1 =""
gen str30 maxsalstr2 =""
gen str30 maxsalstr3 =""

egen First=rowmax(greatergermanyE_sum-immigE_sum)

foreach var of varlist greatergermanyE_sum-immigE_sum { 
 replace maxsalstr1 = maxsalstr1+" "+"`var'" if First==`var'
}


foreach var of varlist greatergermanyE_sum-immigE_sum {
  replace `var'=. if `var'== First
   }
   
egen Second=rowmax(greatergermanyE_sum-immigE_sum)

foreach var of varlist greatergermanyE_sum-immigE_sum {
  replace maxsalstr2 = maxsalstr2+" "+"`var'" if Second==`var'
  }

foreach var of varlist greatergermanyE_sum-immigE_sum {
  replace `var'=. if `var'== Second
   }
   
egen Third=rowmax(greatergermanyE_sum-immigE_sum)

foreach var of varlist greatergermanyE_sum-immigE_sum {
  replace maxsalstr3 = maxsalstr3+" "+"`var'" if Third==`var'
  }

foreach var of varlist greatergermanyE_sum-immigE_sum {
  replace `var'=. if `var'== Third
   }

replace maxsalstr1="none" if First==.
replace maxsalstr2="none" if Second==.
replace maxsalstr3="none" if Third==.

replace maxsalstr1="none" if First==0
replace maxsalstr2="none" if Second==0
replace maxsalstr3="none" if Third==0


list maxsalstr1 maxsalstr2 maxsalstr3 First Second Third



* Selection of the three most salient groups

gen str30 maxsalgr1 =""
gen str30 maxsalgr2 =""
gen str30 maxsalgr3 =""

egen First_gr=rowmax(civicE_sum-youngE_sum)

foreach var of varlist civicE_sum-youngE_sum { 
 replace maxsalgr1 = maxsalgr1+" "+"`var'" if First_gr==`var'
}


foreach var of varlist civicE_sum-youngE_sum {
  replace `var'=. if `var'== First_gr
   }
   
egen Second_gr=rowmax(civicE_sum-youngE_sum)

foreach var of varlist civicE_sum-youngE_sum {
  replace maxsalgr2 = maxsalgr2+" "+"`var'" if Second_gr==`var'
  }

foreach var of varlist civicE_sum-youngE_sum {
  replace `var'=. if `var'== Second_gr
   }
   
egen Third_gr=rowmax(civicE_sum-youngE_sum)

foreach var of varlist civicE_sum-youngE_sum {
  replace maxsalgr3 = maxsalgr3+" "+"`var'" if Third_gr==`var'
  }

foreach var of varlist civicE_sum-youngE_sum {
  replace `var'=. if `var'== Third_gr
   }

replace maxsalgr1="none" if First_gr==.
replace maxsalgr2="none" if Second_gr==.
replace maxsalgr3="none" if Third_gr==.

replace maxsalgr1="none" if First_gr==0
replace maxsalgr2="none" if Second_gr==0
replace maxsalgr3="none" if Third_gr==0

list maxsalgr1 maxsalgr2 maxsalgr3 First Second Third


***********************************************************
*** Section "Mapping parties' policy positions and group appeals  along three cleavages over four elections" ***

use "hmd-EA1-4", clear

drop if seat < 1
gen seatshare = seats/totalseats
sort election
by election: egen seatshare_ps = sum(seatshare)
gen weight = seatshare/seatshare_ps 



* FIGURE 1: Centre-periphery cleavage

gen dimnat_pol = p_nationalismE
gen dimnat_gr = p_czeE - p_gerE

twoway (scatter dimnat_pol dimnat_gr [w=seatshare], mcolor(gs13) msymbol(circle) ylabel(-4 (1) 4) xlabel(-4 (1) 4)), by (election) ||  (scatter dimnat_pol dimnat_gr, mcolor(black) msymbol(x) mlabel(party1) mlabcolor(black) ylabel(-4 (1) 4) xlabel(-6 (1) 6)), by(election)  ytitle("Nationalist policy position") xtitle("pro-German/anti-Czech v. pro-Czech/anti-German")


* FIGURE 2: Class cleavage (group claims multiplied by minus 1 so that left group appeal appears to the left)

gen dimclass_pol =  p_exploitE + p_capismE - (p_soceqE + p_socsecE  + p_pubeducE + p_pubhealthE + p_trunionE)
gen dimclass_gr =  (p_capitalistsE - p_workersE - p_lowclassE + p_uppclassE)

twoway (scatter dimclass_pol dimclass_gr [w=seatshare], mcolor(gs13) msymbol(circle) ylabel(-6 (1) 6) xlabel(-6 (1) 6)), by (election) ||  (scatter dimclass_pol dimclass_gr, mcolor(black) msymbol(x) mlabel(party1) mlabcolor(black) ylabel(-6 (1) 6) xlabel(-6 (1) 6)), by(election)  ytitle("Policy position on class cleavage") xtitle("pro-workers/anti-capitalists v. anti-workers/pro-capitalists")



* FIGURE 3: State-church cleavage

gen dimvalue_pol = p_tradvalE - p_sepchE
gen dimvalue_gr = p_christE + p_romcatE + p_conservativesE + p_clericalsE

twoway (scatter dimvalue_pol dimvalue_gr [w=seatshare], mcolor(gs13) msymbol(circle) ylabel(-6 (1) 6) xlabel(-6 (1) 6)), by (election) ||  (scatter dimvalue_pol dimvalue_gr, mcolor(black) msymbol(x) mlabel(party1) mlabcolor(black) ylabel(-4 (1) 4) xlabel(-4 (1) 4)), by(election)  ytitle("Policy position on state-church cleavage") xtitle("anti v. pro-Christians, Roman Catholics, conservatives and clericals")



****************************************************************************

*** APPENDIX ***

use "hmd-EA1-4", clear


** TABLES IN APPENDIX B1 **

* Three most salient issues for each party in each election

gen str30 maxsalstr1 =""
gen str30 maxsalstr2 =""
gen str30 maxsalstr3 =""

egen First=rowmax(greatergermanyE-immigE)

foreach var of varlist greatergermanyE-immigE { 
 replace maxsalstr1 = maxsalstr1+" "+"`var'" if First==`var'
}


foreach var of varlist greatergermanyE-immigE {
  replace `var'=. if `var'== First
   }
   
egen Second=rowmax(greatergermanyE-immigE)

foreach var of varlist greatergermanyE-immigE {
  replace maxsalstr2 = maxsalstr2+" "+"`var'" if Second==`var'
  }

foreach var of varlist greatergermanyE-immigE {
  replace `var'=. if `var'== Second
   }
   
egen Third=rowmax(greatergermanyE-immigE)

foreach var of varlist warE-immigE {
  replace maxsalstr3 = maxsalstr3+" "+"`var'" if Third==`var'
  }

foreach var of varlist greatergermanyE-immigE {
  replace `var'=. if `var'== Third
   }
   

drop if nationalistparty_E==.

replace maxsalstr1="none" if First==.
replace maxsalstr2="none" if Second==.
replace maxsalstr3="none" if Third==.

replace maxsalstr1="none" if First==0
replace maxsalstr2="none" if Second==0
replace maxsalstr3="none" if Third==0

sort election party1

keep election party1 maxsalstr1 maxsalstr2 maxsalstr3



* Three most salient groups for each party in each election

use "hmd-EA1-4", clear


gen str30 maxsalgr1 =""
gen str30 maxsalgr2 =""
gen str30 maxsalgr3 =""

egen First=rowmax(civicE-youngE)

foreach var of varlist civicE-youngE { 
 replace maxsalgr1 = maxsalgr1+" "+"`var'" if First==`var'
}


foreach var of varlist civicE-youngE {
  replace `var'=. if `var'== First
   }
   
egen Second=rowmax(civicE-youngE)

foreach var of varlist civicE-youngE {
  replace maxsalgr2 = maxsalgr2+" "+"`var'" if Second==`var'
  }

foreach var of varlist civicE-youngE {
  replace `var'=. if `var'== Second
   }
   
egen Third=rowmax(civicE-youngE)

foreach var of varlist civicE-youngE {
  replace maxsalgr3 = maxsalgr3+" "+"`var'" if Third==`var'
  }

foreach var of varlist civicE-youngE {
  replace `var'=. if `var'== Third
   }
   

drop if nationalistparty_E==.


replace maxsalgr1="none" if First==.
replace maxsalgr2="none" if Second==.
replace maxsalgr3="none" if Third==.

replace maxsalgr1="none" if First==0
replace maxsalgr2="none" if Second==0
replace maxsalgr3="none" if Third==0

sort election party1

keep election party1 maxsalgr1 maxsalgr2 maxsalgr3





** APPENDIX TABLE B2. Cronbach's Alpha  **


use "hmd-EA1-4", clear

* Centre-periphery clevage: groups

alpha p_czeE p_gerE 
alpha p_nationalismE p_czeE p_gerE 


* Class clevage: Issues and groups

alpha p_capismE p_exploitE p_trunionE p_pubhealthE p_pubeducE p_socsecE p_soceqE
alpha p_workersE p_capitalistsE p_lowclassE p_uppclassE 
alpha p_capismE p_exploitE p_trunionE p_pubhealthE p_pubeducE p_socsecE p_soceqE p_workersE p_capitalistsE p_lowclassE p_uppclassE 


* State-church clevage: Issues and groups

alpha p_tradvalE p_sepchE
alpha p_christE p_romcatE p_conservativesE p_clericalsE
alpha p_tradvalE p_sepchE p_christE p_romcatE p_conservativesE p_clericalsE



** APPENDIX TABLE B3. Values for salience, polarization and politicization of each of the cleavages **


* Salience of cleavages

use "hmd-EA1-4", clear

gen seatshare = seats/totalseats
sort election
by election: egen seatshare_ps = sum(seatshare)
gen weight = seatshare/seatshare_ps 

sort election

by election: gen nat_pol_sal = nationalismE
by election: gen nat_pol_sal_w = weight * nat_pol_sal
by election: egen nat_pol_sal_sum=sum(nat_pol_sal_w)

by election: gen nat_gr_sal = czeE + gerE
by election: gen nat_gr_sal_w = weight * nat_gr_sal
by election: egen nat_gr_sal_sum=sum(nat_gr_sal_w)

by election: gen class_pol_sal = exploitE + capismE + soceqE + socsecE + pubeducE + pubhealthE + trunionE 
by election: gen class_pol_sal_w = weight * class_pol_sal
by election: egen class_pol_sal_sum=sum(class_pol_sal_w)

by election: gen class_gr_sal = workersE + capistsE + lowclassE + uppclassE
by election: gen class_gr_sal_w = weight * class_gr_sal
by election: egen class_gr_sal_sum=sum(class_gr_sal_w)

by election: gen value_pol_sal = tradvalE + sepchE 
by election: gen value_pol_sal_w = weight * value_pol_sal
by election: egen value_pol_sal_sum=sum(value_pol_sal_w)

by election: gen value_gr_sal = christE + romcatE + conservativesE + clericalsE 
by election: gen value_gr_sal_w = weight * value_gr_sal
by election: egen value_gr_sal_sum=sum(value_gr_sal_w)


* Polarisation of cleavages

by election: gen nat_pol_pos = p_nationalismE 
by election: gen nat_pol_pos_w = weight * nat_pol_pos
by election: egen nat_pol_pos_sum = sum(nat_pol_pos_w)
by election: gen nat_pol_pos_ind = weight * (nat_pol_pos - nat_pol_pos_sum)^2
by election: egen nat_pol_pos_polar = sum(nat_pol_pos_ind)

by election: gen nat_gr_pos = p_czeE - p_gerE 
by election: gen nat_gr_pos_w = weight * nat_gr_pos
by election: egen nat_gr_pos_sum = sum(nat_gr_pos_w)
by election: gen nat_gr_pos_ind = weight * (nat_gr_pos - nat_gr_pos_sum)^2
by election: egen nat_gr_pos_polar = sum(nat_gr_pos_ind)


by election: gen class_pol_pos = p_exploitE + p_capismE - (p_soceqE + p_socsecE  + p_pubeducE + p_pubhealthE + p_trunionE)
by election: gen class_pol_pos_w = weight * class_pol_pos
by election: egen class_pol_pos_sum	= sum(class_pol_pos_w)
by election: gen class_pol_pos_ind = weight *(class_pol_pos - class_pol_pos_sum)^2
by election: egen class_pol_pos_polar = sum(class_pol_pos_ind)

by election: gen class_gr_pos = p_workersE - p_capitalistsE + p_lowclassE - p_uppclassE
by election: gen class_gr_pos_w = weight*class_gr_pos
by election: egen class_gr_pos_sum = sum(class_gr_pos_w)
by election: gen class_gr_pos_ind = weight * (class_gr_pos - class_gr_pos_sum)^2
by election: egen class_gr_pos_polar = sum(class_gr_pos_ind)

by election: gen value_pol_pos = p_tradvalE - p_sepchE 
by election: gen value_pol_pos_w=weight * value_pol_pos
by election: egen value_pol_pos_sum	=sum(value_pol_pos_w)
by election: gen value_pol_pos_ind=weight*(value_pol_pos - value_pol_pos_sum)^2
by election: egen value_pol_pos_polar=sum(value_pol_pos_ind)

by election: gen value_gr_pos = p_christE + p_romcatE + p_conservativesE + p_clericalsE 
by election: gen value_gr_pos_w = weight * value_gr_pos
by election: egen value_gr_pos_sum	=sum(value_gr_pos_w)
by election: gen value_gr_pos_ind = weight * (value_gr_pos - value_gr_pos_sum)^2
by election: egen value_gr_pos_polar = sum(value_gr_pos_ind)


* Politicisation of cleavages

by election: gen nat_pol_polit = nat_pol_sal_sum * nat_pol_pos_polar
by election: gen nat_gr_polit = nat_gr_sal_sum * nat_gr_pos_polar
by election: gen class_pol_polit = class_pol_sal_sum * class_pol_pos_polar
by election: gen class_gr_polit = class_gr_sal_sum * class_gr_pos_polar
by election: gen value_pol_polit = value_pol_sal_sum * value_pol_pos_polar
by election: gen value_gr_polit = value_gr_sal_sum * value_gr_pos_polar


sort election
by election: gen count = _n
drop if count !=1

keep election nat_pol_polit nat_gr_polit nat_pol_sal_sum nat_gr_sal_sum nat_pol_pos_polar nat_gr_pos_polar class_pol_polit class_pol_sal_sum class_pol_pos_polar class_gr_polit class_gr_sal_sum class_gr_pos_polar value_pol_polit value_pol_sal_sum value_pol_pos_polar value_gr_polit value_gr_sal_sum value_gr_pos_polar

